feature: implement dark mode support for webstatus.dev#2280
feature: implement dark mode support for webstatus.dev#2280jcscottiii wants to merge 5 commits intomainfrom
Conversation
Updates the GEMINI.md file to include the latest information about the project, including new features, bug fixes, and improvements. This commit ensures that the documentation is up-to-date and provides accurate information to users and contributors.
Uses Mermaid to create diagrams that illustrate the architecture of the project. This documentation will help new contributors understand the structure and components of the project more quickly.
This commit transitions the large, monolithic project context in `GEMINI.md` into modular Gemini CLI Skills stored in the `skills/` directory. Benefits: - Reduced token overhead by leveraging Progressive Disclosure (triggering specific skills only when relevant). - Improved agent reliability with more focused, domain-specific instructions. - Simplified maintenance of specialized architectural and workflow documentation. Key Changes: - Created 7 new skills: backend, frontend, e2e, ingestion, workers, search-grammar, and maintenance. - Added `make link-skills` to the `Makefile` for easy skill registration. - Automated skill linking in `.devcontainer/post_attach.sh`. - Trimmed `GEMINI.md` to a high-level entry point that points to the skills.
This commit implements dark mode support for webstatus.dev, allowing users to switch between light and dark themes for a more personalized browsing experience. The implementation includes: - A new theme context to manage the current theme state across the application. - A theme toggle button in the header to allow users to switch themes easily. - Updated CSS to support both light and dark themes, ensuring a consistent look and feel across the site. - Updated end-to-end tests to verify that the dark mode functionality works correctly and that the UI renders appropriately in both themes. Fixes 744
|
This was my first time using Antigravity and I was pleasantly surprised! |
|
I did ask it why not use the new light-dark feature, it said the following: That is a great question. The short answer is: It would be technically easy to use, but arguably redundant given your current architectural reliance on Shoelace. Here is a breakdown of how it would interact with your codebase: How it works with Shoelace: The light-dark() function depends entirely on the CSS color-scheme property. For it to work, an element (or its ancestor) must have color-scheme: light or color-scheme: dark set. Since your WebstatusThemeService toggles the .sl-theme-dark class on the root, and Shoelace's dark.css included in your project automatically sets color-scheme: dark on that class, light-dark() would "just work" inside any of your components. /* You could do this in _theme-css.ts */
:host {
--color-background: light-dark(white, var(--sl-color-gray-950));
}Pros: Why you might want it Conciseness: It eliminates the need for separate :host and .sl-theme-dark blocks for simple color switches. Cons: Why it might be "not really" easy/useful right now Redundancy with Shoelace: You are already mapping to Shoelace variables like --sl-color-neutral-0. These variables already change their values when the theme toggles. Using light-dark() on top of them is essentially doing the same work twice. Final Thoughts Why? Because Shoelace is your "Source of Truth." By saying --color-background: var(--sl-color-neutral-0), you are telling your component: "Whatever Shoelace thinks 'Background 0' is, use that." If the user switches themes, Shoelace updates that variable, and your component follows along perfectly across all browsers. light-dark() is great for projects without a heavy UI library like Shoelace, where you have to manually define every bridge between light and dark. |
DanielRyanSmith
left a comment
There was a problem hiding this comment.
This is very awesome! Excited to try this out (Antigravity and this dark mode) 🙂
I would love to see your prompt process on this (That gives me an idea that I should probably add my prompts to my PRs as well)
There was a problem hiding this comment.
Nit: The "Page not found" is a little hard to read. This could be fixed by just increasing the contrast of the color from the background.
...ation-channels.spec.ts-snapshots/notification-channels-authenticated-dark-chromium-linux.png
Show resolved
Hide resolved
I asked it this: It said the following: Recap: Dark Mode Implementation & Collaboration JourneyThis document captures the "behind the scenes" of our session and serves as a guide for how to effectively pair-program with me (the AI) on complex frontend tasks. 1. How We Started: Feature ImplementationThe goal was to implement a global light/dark mode for
2. Prompts that worked (How to get started)Here are the specific prompts from this session that were most effective: Phase 1: The Initial Request
Phase 2: High-Level Debugging
Phase 3: Build Error Correction
Phase 4: Steering & Planning
Phase 5: Knowledge Transfer
3. The "Wall": Cross-Browser SpecificityWe discovered that while dark mode worked in Chrome, it failed in Firefox and WebKit (Safari). Backgrounds stayed white, and text was invisible.
3. The Power of User PushbackThis was the most important part of our collaboration. When the build failed, I proposed "moving everything into index.html."
4. The Clean Solution: Semantic MappingInstead of forcing overrides, we updated _theme-css.ts to map our custom variables (e.g.,
5. Architectural Formalization (The "Pro" Move)At the end, we didn't just fix the code; we fixed the Knowledge Base.
Summary: How to use AI effectively
|
jrobbins
left a comment
There was a problem hiding this comment.
LGTM, with a few comments, and I agree with Daniel that some of the dark colors are hard to read but those could be tweaked in follow-ups.
|
|
||
| render() { | ||
| const isDark = this.theme === 'dark'; | ||
| const detectingTheme = this.theme === undefined; |
There was a problem hiding this comment.
Would this ever be true if the webstatus-theme-button is enclosed in a theme service element? It seems like good defensive coding, I was just curious if it was ever expected to happen.
There was a problem hiding this comment.
Good catch. I meant to actually have theme's default be undefined. Will fix.
e2e/tests/feature-page.spec.ts
Outdated
| await expect(pageContainer).toHaveScreenshot(); | ||
| }); | ||
|
|
||
| test('matches the screenshot in dark mode', async ({page}) => { |
There was a problem hiding this comment.
Would full testing for dark mode double the number of playwright tests? That might slow things down and increase our code volume and create opportunities for some tests to fall out of date. Would it be better to make a wrapper function around toHaveScreenshot() that would force light then a light screenshot, the force dark and check a dark screenshot. And, then force light again to reset for the next test.
There was a problem hiding this comment.
That makes sense! will do.
75e2677 to
7532d96
Compare
This commit implements dark mode support for webstatus.dev, allowing users to switch between light and dark themes for a more personalized browsing experience. The implementation includes:
Fixes #744